using System;
using System.Windows.Data;
using System.Globalization;

namespace ibba.src.norisk
{
    public class PropertyNameConverter : IValueConverter
    {
        string _groupHeader;

        #region Constructions

        public PropertyNameConverter()
        {
            _groupHeader = "";
        }

        public PropertyNameConverter(string pGroupHeader)
        {
            _groupHeader = pGroupHeader;
        }

        #endregion

        #region IValueConverter Members

        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null)
                value = "(Nulo)";

            return String.Concat(_groupHeader, value.ToString());
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            //throw new NotImplementedException();
            return value;
        }

        #endregion
    }
}
